GtkThemingEngine: Improve slider rendering.
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 19 Jul 2010 10:00:07 +0000 (12:00 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:37:22 +0000 (15:37 +0100)
gtk/gtkthemingengine.c

index 7457bc3ca31f253be9017b84081c8aec56de08fb..5f34ce31c0485b4e23cd8f0b86fe7633312e3e45 100644 (file)
@@ -1369,22 +1369,30 @@ gtk_theming_engine_render_slider (GtkThemingEngine *engine,
                                   GtkOrientation    orientation)
 {
   const GtkWidgetPath *path;
+  gint thickness;
 
   path = gtk_theming_engine_get_path (engine);
 
   gtk_theming_engine_render_background (engine, cr, x, y, width, height);
   gtk_theming_engine_render_frame (engine, cr, x, y, width, height);
 
-  if (gtk_widget_path_has_parent (path, GTK_TYPE_SCALE))
+  /* FIXME: thickness */
+  thickness = 2;
+
+  if (gtk_widget_path_is_type (path, GTK_TYPE_SCALE))
     {
       if (orientation == GTK_ORIENTATION_VERTICAL)
         gtk_theming_engine_render_line (engine, cr,
-                                        x + 2, y + height / 2 - 1,
-                                        x + width - 4, y + height / 2 - 1);
+                                        x + thickness,
+                                        y + (gint) height / 2,
+                                        x + width - thickness - 1,
+                                        y + (gint) height / 2);
       else
         gtk_theming_engine_render_line (engine, cr,
-                                        x + width / 2 - 1, y + 4,
-                                        x + width / 2 - 1, y + height - 4);
+                                        x + (gint) width / 2,
+                                        y + thickness,
+                                        x + (gint) width / 2,
+                                        y + height - thickness - 1);
     }
 }